//
//  NumberStringMap.swift
//  E-CycleForShop
//
//  Created by enghou on 17/3/17.
//  Copyright © 2017年 xyxorigation. All rights reserved.
//

import UIKit

class NumberStringMap: NSObject {
    public class func toString(array : Array<String>,contentArr : Array<String>)->String{
        var dic : Dictionary<String,String> = [:]
        
        var i = 0
        
        if contentArr.count == 0 {
            return ""
        }
        
        for item in contentArr {
            dic[String(i)] = item
            i = i + 1
        }
        var result : String = ""
        for item in array {
            if let value = dic[item] {
                result = result + value + ","
            }
        }
        if result.characters.count > 0 {
            result = result.substring(to: result.index(before: result.endIndex))
        }
        return result
    }
}
